package de.hsmannheim.poolraumapp.model;

import org.joda.time.LocalTime;

public class LessonBlock {
	private int block;
	private String department;
	private LocalTime begin;
	private LocalTime end;
	
	public LessonBlock(int block, String department, LocalTime begin, LocalTime end) {
		this.block = block;
		this.department = department;
		this.begin = begin;
		this.end = end;
	}
	
	public int getBlock() {
		return block;
	}
	public String getDepartment() {
		return department;
	}
	public LocalTime getBegin() {
		return begin;
	}
	public LocalTime getEnd() {
		return end;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((begin == null) ? 0 : begin.hashCode());
		result = prime * result + block;
		result = prime * result
				+ ((department == null) ? 0 : department.hashCode());
		result = prime * result + ((end == null) ? 0 : end.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		LessonBlock other = (LessonBlock) obj;
		if (begin == null) {
			if (other.begin != null)
				return false;
		} else if (!begin.equals(other.begin))
			return false;
		if (block != other.block)
			return false;
		if (department == null) {
			if (other.department != null)
				return false;
		} else if (!department.equals(other.department))
			return false;
		if (end == null) {
			if (other.end != null)
				return false;
		} else if (!end.equals(other.end))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "LessonBlock [block=" + block + ", department=" + department
				+ ", begin=" + begin + ", end=" + end + "]";
	}
	
	
}
